<template>
  <van-nav-bar
    title="常用专科问卷"
    left-arrow
    @click-left="onBack"
    right-text=""
  >

  </van-nav-bar>
  <div class="questionnaire-page">
    <div class="questionnaire-desc">
      国内外常用的泌尿外科专科问卷<br />
      用于辅助诊断、判断疾病的严重程度。<br />
      阶段性评估疗效,健康状态,为诊疗方案提供佐证
    </div>
    <div class="category-grid">
      <div
        v-for="(cat, idx) in categories"
        :key="cat.label"
        :class="['category-btn', { active: idx === selectedCategory }]"
        @click="selectCategory(idx)"
      >
        {{ cat.label }}
      </div>
    </div>
    <div class="questionnaire-list">
      <div class="questionnaire-item" v-for="item in questionnaires" :key="item.title">
        <div class="item-title">{{ item.title }}</div>
        <div class="item-action" @click="fill(item)">
          填写 <van-icon name="arrow" />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const onBack = () => router.back()
const categories = [
  { label: '膀胱活跃症相关' },
  { label: '尿失禁相关' },
  { label: '间质性膀胱炎相关' },
  { label: '男科/前列腺相关' },
  { label: '尿道重建修复' },
  { label: '肠道相关' },
  { label: '精神心理' },
  { label: '其他' },
]
const selectedCategory = ref(0)
const selectCategory = (idx: number) => {
  selectedCategory.value = idx
}
const questionnaires = [
  { title: '膀胱过度活动症患者症状评估表(OABSS)' },
  { title: 'OAB-q' },
  { title: '国际尿失禁咨询委员会尿失禁问卷表简表(ICI-Q-SF)' },
  { title: 'UDI-6' },
  { title: '生活质量调查表IIQ-7 short form' },
]
const fill = (item: any) => {
  router.push('/assessment/questionnaire/fill')
}
</script>

<style scoped lang="scss">
.questionnaire-page {
  background: #fff;
  min-height: 100vh;
  padding: 0 16px 16px 16px;
}
.van-nav-bar {
  background: #fff;
}
.nav-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  color: #222;
}
.questionnaire-desc {
  font-size: 32px;
  color: #222;
  margin: 24px 0 24px 0;
  line-height: 1.5;
  font-weight: 400;
}
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 24px;
  margin-bottom: 32px;
}
.category-btn {
  background: #fff;
  border: 2px solid #19a7e0;
  color: #19a7e0;
  border-radius: 8px;
  font-size: 32px;
  font-weight: 500;
  padding: 28px 0;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.category-btn.active {
  background: #19a7e0;
  color: #fff;
}
.questionnaire-list {
  margin-top: 24px;
}
.questionnaire-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f3f3f3;
  border-radius: 4px;
  padding: 32px 24px;
  font-size: 32px;
  color: #222;
  margin-bottom: 12px;
}
.item-title {
  flex: 1;
  font-size: 30px;
  color: #222;
  font-weight: 500;
}
.item-action {
  color: #19a7e0;
  font-size: 32px;
  font-weight: 500;
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 4px;
}
.van-nav-bar__title {
  font-size: 40px !important;
  font-weight: 600;
}
</style> 